function HashRouter() {
    BaseRouter.call(this);
}

HashRouter.prototype = new BaseRouter;

HashRouter.prototype.constructor = HashRouter;

HashRouter.prototype.init = function () {
    var _that = this;
    this.router.subscribe('routerChange', function (e) {
        var fullUrl = e.href
        var fullpathIndex = fullUrl.indexOf('#') + 1;
        var fullpath = fullUrl.slice(fullpathIndex);
        var path = _that.getRoutePath(fullpath);
        _that.router.publish('*', fullpath);
        _that.publish(path, fullpath);
    });

    window.addEventListener('hashchange', function (e) {
        publishRouter();
    });

    function publishRouter() {
        _that.router.publish('routerChange', window.location);
    }

    publishRouter();

    this.addLinkEvent();
}


HashRouter.prototype.jumpTo = function jumpTo(path) {
    if (path === '/') {
        return false;
    }
    window.location.href = '#/' + path;
}